﻿@model GPI.Models.GPI_PROJECT

@{
    ViewBag.Title = "Modification";
}

<h2>Modification</h2>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<script type="text/javascript" src="@Url.Content("~/Content/Javascript/ckeditor/ckeditor.js")"></script>

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>PROJET</legend>

        <div class="editor-label">
            @Html.LabelFor(model => model.title)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.title)
            @Html.ValidationMessageFor(model => model.title)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.description)
        </div>
        <div class="editor-field">
            @Html.TextAreaFor(model => model.description, new { @class="ckeditor" })
            @Html.ValidationMessageFor(model => model.description)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.max_students)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.max_students)
            @Html.ValidationMessageFor(model => model.max_students)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.YEAR)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.YEAR)
            @Html.ValidationMessageFor(model => model.YEAR)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.FK_Client, "Client")
        </div>
        <div class="editor-field">
            @Html.DropDownList("FK_Client", String.Empty)
            @Html.ValidationMessageFor(model => model.FK_Client)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.FK_Prof, "Prof.")
        </div>
        <div class="editor-field">
            @Html.DropDownList("FK_Prof", String.Empty)
            @Html.ValidationMessageFor(model => model.FK_Prof)
        </div>

        <div class="editor-field">
    <table>
        <tr>
            @{
                int cnt = 0;
                List<GPI.ViewModel.AssignedTechnologyData> techs = ViewBag.Technologies;

                foreach (var tech in techs) {
                    if (cnt++ % 3 == 0) {
                        @:  </tr> <tr> 
                    }
                    @: <td> 
                        <label><input type="checkbox" 
                               name="selectedTechnologies" 
                               value="@tech.TechnologyID" 
                               @(Html.Raw(tech.Assigned ? "checked=\"checked\"" : "")) /> 
                        @tech.Title
                        </label>
                    @:</td>
                }
                @: </tr>
            }
    </table>
</div>

        <p>
            <input type="submit" value="Sauvegarder" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Retour à la liste", "Index")
</div>
<script language="javascript" type="text/javascript">
jQuery(".adminRichText").ckeditor()</script>